class_name MainMenuView
extends BaseView

#region 属性
@export var start_btn:AnimatedButton
@export var record_btn:AnimatedButton
@export var quit_btn:AnimatedButton
var connect_obj_dict:Dictionary[Signal,ConnectObj] = {}
#endregion
#region 字段
#endregion
#region 信号
#endregion

#region 基类方法
func init_view():
	super.init_view()
	connect_obj_dict[start_btn.pressed] = ConnectObj.new(start_btn.pressed,[_on_start_btn_pressed])
	connect_obj_dict[record_btn.pressed] = ConnectObj.new(record_btn.pressed,[_on_record_btn_pressed])
	connect_obj_dict[quit_btn.pressed] = ConnectObj.new(quit_btn.pressed,[_on_quit_btn_pressed])
func on_enter(args:Dictionary = {}):
	super.on_enter(args)
func on_pause(args:Dictionary = {}):
	super.on_pause(args)
func on_resume(args:Dictionary = {}):
	super.on_resume(args)
func on_exit(args:Dictionary = {}):
	for connect_obj:ConnectObj in connect_obj_dict.values():
		if connect_obj:
			connect_obj.disconnect_all()
	super.on_exit(args)
func get_view_state() -> GameEnum.ViewState:
	return super.get_view_state()
#endregion
#region 公共方法
#endregion
#region 私有方法
func _on_start_btn_pressed():
	GameManager.start_game()
func _on_record_btn_pressed():
	GameViewSystem.open_view(GameEnum.ViewType.RecordView,{})
func _on_quit_btn_pressed():
	GameManager.quit_game()
#endregion
#region 生命周期函数
#endregion
